<?php
/**
 */
class MemberEmailsTable extends Doctrine_Table
{
	 public function memsecemails($memberid)
	{
	    //echo $email;exit;
		$query=new Doctrine_Query();
		$query->select('m.*')
			  ->from('MemberEmails m')
			  ->where("m.member_id='".$memberid."'");
	    //echo $query->getSql();exit;
		$result = $query->execute(array(),Doctrine::HYDRATE_ARRAY);
		return $result;	  
	}
	public function deleteEmails($memberid)
	{   
    	//echo $email;exit;
		$query=new Doctrine_Query();
		$query->delete('m.*')
			  ->from('MemberEmails m')
			  ->where("m.member_id='".$memberid."'");
	    //echo $query->getSql();exit;
		$result = $query->execute();
		return $result;	  
	}
	public function addEmails($memberid,$email)
	{   
    	$usermail = new MemberEmails();
		$usermail ->member_id = $memberid;
		$usermail ->sec_email = $email;
		$usermail ->save();
		return $usermail->iid;  
	}
}